const app = getApp()

Page({
  data: {
    info: null,
    my: [{
        img: "./images/order.png",
        name: '订单列表',
        url: '/lives/admin/order-list/order-list'
      }, {
        img: "./images/goods.png",
        name: '商品列表',
        url: '/lives/admin/goods-list/goods-list'
      }, {
        img: "./images/share.png",
        name: '分销明细',
        url: '/lives/admin/share-list/share-list'
      },
      {
        img: "./images/logs.png",
        name: '直播记录',
        url: '/lives/admin/live-log/live-log'
      }
    ],
    more: [{
      img: "./images/cash.png",
      name: '提现申请',
      url: '/lives/admin/cash/cash'
    }, {
      img: "./images/share.png",
      name: '提现记录',
      url: '/lives/admin/cash-detail/cash-detail'
    }
    // {
    //   img: "./images/message.png",
    //   name: '消息'
    // }
    ]
  },
  // live_package:function(){
  //   wx.switchTab({
  //     url: '/mch/m/mch-live-package',
  //   })
  //   // wx.switchTab({
  //   //   url: 'url',
  //   // })
  // },
  onLoad: function () {
    this.getData()
  },

  getData: function () {
    wx.showLoading({
      title: '加载中...',
    });
    getApp().request({
      url: getApp().api.live.get_anchor_info,
      success: res => {
        if (res.code == 0) {
          this.setData({
            info: res.data
          })
        }
      },
      complete: () => {
        wx.hideLoading();
      }
    })
  },

  goToPage: function (e) {
    let url = e.currentTarget.dataset.url
    wx.navigateTo({
      url: url
    })
  }
})